package com.atguigu.java.ai.langchain4j.service.impl;

import com.atguigu.java.ai.langchain4j.entity.Appointment;
import com.atguigu.java.ai.langchain4j.mapper.AppointmentMapper;
import com.atguigu.java.ai.langchain4j.service.AppointmentService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import dev.langchain4j.agent.tool.P;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: zhang
 * @Date: 2025/9/1 16:24
 * @Description:
 **/
@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements AppointmentService {


    @Autowired
    public AppointmentMapper appointmentMapper;
    @Override
    public Appointment getOne(Appointment appointment) {
        LambdaQueryWrapper<Appointment> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Appointment::getUsername,appointment.getUsername());
        wrapper.eq(Appointment::getIdCard,appointment.getIdCard());
        wrapper.eq(Appointment::getDepartment,appointment.getDepartment());
        wrapper.eq(Appointment::getDate,appointment.getDate());
        wrapper.eq(Appointment::getTime,appointment.getTime());

        Appointment appointment1 = appointmentMapper.selectOne(wrapper);

        return appointment1;
    }
}
